<?php
namespace app\admin\validate;

use think\Validate;

class Members extends Validate
{
    protected $rule = [
        'name' => 'require',
        'membercard' => 'require|unique:members',
        'moblie' => 'require'
    ];

    protected $message = [
        'name.require' => '请填写姓名',
        'membercard.unique' => '会员卡号已存在',
        'membercard.require' => '请填写会员卡',
        'moblie.require' => '请填写手机'
    ];

    protected $scene = [
        'add'   => ['name', 'membercard', 'moblie'],
        'edit'  => ['name', 'membercard', 'moblie']
    ];
}